/*
 * @Author: zhangjingyu
 * @Date: 2020-10-13 14:12:54
 * @LastEditors: zhangjingyu
 * @LastEditTime: 2020-12-07 21:34:40
 * @FilePath: \vprisk-weifuwu\src\router\index.js
 * @Description: 
 */
import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/Login/login')
  },
  {
    path: '/',
    name: 'Index',
    component: () => import('@/views/Main'),
    children: [
      {
        path: '404',
        name: '404',
        component: () => import('@/views/Others/404')
      },
      {
        path: 'home',
        name: 'home',
        component: () => import('@/views/Home/Home')
      },
      {
        path: 'notification',
        name: 'notification',
        component: () => import('@/views/Others/notification')
      },
      {
        path: 'PageOne',
        name: 'PageOne',
        component: () => import('@/views/Others/PageOne')
      }
    ]
  }
]
// 处理重复跳转路由报错
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
const router = new VueRouter({
  routes
})

export default router
